<?php

	class CTrace
	{
		static function GetStat()
		{
			static $iStartTm       = 0;
			static $iStartCodeLine = 0;
			
			$aTrace     = debug_backtrace();
			$aCallInfo  = array_shift($aTrace);
			$iCodeLine  = $aCallInfo['line'];
			
			$aTemp      = explode('/',$aCallInfo['file']);
			$szFile     = array_pop($aTemp);
			
			if($iStartTm === 0)
			{
				echo "Initialize (file: ".$szFile." ) <br/>";
				
				$iStartTm  	     = time() + microtime();
				$iStartCodeLine = $iCodeLine;
				
				return 0;
			}
			
			printf("debug: (%s)> code-lines: %d-%d (lines: %d ) time: %.4f  <br/>",
				   $szFile,
				   $iStartCodeLine,
				   $iCodeLine,
				   $iCodeLine-$iStartCodeLine,
				   (time() + microtime() - $iStartTm));
			
			$iStartTm = time() + microtime();
			
			$iStartCodeLine = $iCodeLine;
		}


	}

?>